Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Maintenance Mode - suggestion #49

Closed
gildonei opened this issue Jun 18, 2019 · 24 comments
Closed

[RFC] Maintenance Mode - suggestion #49

gildonei opened this issue Jun 18, 2019 · 24 comments
Assignees
Labels
accepted For accepted RFCs (Requests For Changes) Implemented Implemented RFC new feature For new features to test

Comments

@gildonei
Copy link
Contributor

Summary

I think would be nice if Ubiquity have a native maintenance mode, that could be activated in config through webadmin or devtools, and when in maitenance, it only allows backend access interface, and in front a page with a maintenance message or similar

Motivation

All major CMS (WordPress, Joomla, Drupal) have a similar functionality, that allows properly config system without break the front, keeping a maintenance page and maybe an http respose

Compatibility with Ubiquity's philosophy

Indicate compatibility or improvements in:

  • ease of use

Expected results

Visitors of website developed with Ubiquity will see a maintenance page instead of the site while It is setted to be down.

@gildonei gildonei added the new feature For new features label Jun 18, 2019
@jcheron
Copy link
Contributor

jcheron commented Jun 18, 2019

Ubiquity is not a CMS, but it's a good idea...
So we disable all URLs except the Admin access URLs, and we refer to a customizable maintenance page?

@gildonei
Copy link
Contributor Author

Yes (not a CMS, is a framework), and yes disable Url except admin routes.
I think should be a config item for a maintenance title and message, so, when in a maintenance mode is set to On, /index only shows the title and message, and allows admin route.
Rest Services should be disabled to, with a default response

@jcheron jcheron added the accepted For accepted RFCs (Requests For Changes) label Jun 18, 2019
@jcheron jcheron changed the title Maintenance Mode - suggestion [RFC] Maintenance Mode - suggestion Jun 22, 2019
@jcheron
Copy link
Contributor

jcheron commented Jun 22, 2019

The maintenance mode can be tested before its integration in version 2.1.5 (composer require phpmv/ubiquity:dev-master in a new project).

For the principle (in the background), the maintenance mode works by adding a route to a maintenance controller, excluding for example administration (Urls starting with admin or Admin).

I will add by default a comingSoon mode (for the example).

Maintenance is accessible in the webtools in the Maintenance section.

I have not yet integrated the REST Urls, and the maintenance mode is not accessible with the devtools.

@jcheron jcheron added Implemented Implemented RFC to test labels Jun 22, 2019
@gildonei
Copy link
Contributor Author

I got a fatal error
Fatal error: Class 'Ubiquity\controllers\admin\UbiquityMyAdminBaseController' not found in C:\wamp64\www\ubiquity\html\app\controllers\Admin.php on line 5 after run composer require

Do i forgot to do something? I ran it on a almost blank project (it has only a model)

@jcheron
Copy link
Contributor

jcheron commented Jun 26, 2019

you must explicitly include webtools:
composer require phpmv/ubiquity-webtools:dev-master

see #50

@gildonei
Copy link
Contributor Author

gildonei commented Jun 26, 2019

Fatal error: Declaration of Ubiquity\controllers\admin\traits\ModelsTrait::showSimpleMessage($content, $type, $title = NULL, $icon = 'info', $timeout = NULL, $staticName = NULL): Ajax\semantic\html\collections\HtmlMessage must be compatible with Ubiquity\controllers\semantic\MessagesTrait::showSimpleMessage($content, $type, $title = NULL, $icon = 'info', $timeout = NULL, $staticName = NULL, $closeAction = NULL): Ajax\semantic\html\collections\HtmlMessage in C:\wamp64\www\ubiquity\html\vendor\phpmv\ubiquity-webtools\src\Ubiquity\controllers\admin\UbiquityMyAdminBaseController.php on line 67

`· The project folder is C:\wamp64\www\ubiquity\html

· PHP 7.1.9
· Ubiquity devtools (1.2.6)
· Ubiquity 2.1.5`

@jcheron
Copy link
Contributor

jcheron commented Jun 26, 2019

maybe the devtools are not up to date...
composer global update
composer global require phpmv/ubiquity-devtools:dev-master
and then recreates a new project:
Ubiquity new testMaintenance -a
in which you go to 2.2.0 (or 2.1.5)
composer require phpmv/ubiquity:dev-master

@gildonei
Copy link
Contributor Author

2.1.5

C:\wamp64\www\ubiquity\html> composer global update
Changed current directory to C:/Users/Gildonei/AppData/Roaming/Composer
Loading composer repositories with package information

Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files

C:\wamp64\www\ubiquity\html>ubiquity version


    · The project folder is C:\wamp64\www\ubiquity\html

    · PHP 7.1.9
    · Ubiquity devtools (1.2.6)
    · Ubiquity 2.1.5

@jcheron
Copy link
Contributor

jcheron commented Jun 27, 2019

devtools would be 1.2.7
image

@gildonei
Copy link
Contributor Author

Tried to follow steps above but in the end got same errors

image

@gildonei
Copy link
Contributor Author

I will update everything to dev-master (ubiquity, devtools, webtools) see what happens

@gildonei
Copy link
Contributor Author

Update

C:\wamp64\www\ubiquity>composer global require phpmv/ubiquity:dev-master
Changed current directory to C:/Users/Gildonei/AppData/Roaming/Composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 0 updates, 0 removals
Generating autoload files

C:\wamp64\www\ubiquity>composer global require phpmv/ubiquity-devtools:dev-master
Changed current directory to C:/Users/Gildonei/AppData/Roaming/Composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 0 updates, 0 removals
Generating autoload files

C:\wamp64\www\ubiquity>composer global require phpmv/ubiquity-webtools:dev-master
Changed current directory to C:/Users/Gildonei/AppData/Roaming/Composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 0 updates, 0 removals
Generating autoload files

C:\wamp64\www\ubiquity>

After update

C:\wamp64\www\ubiquity>ubiquity new html -a -b=dsv_ubiquity -s=192.168.0.70 -u=teste -w=teste -h=semantic -i=https://ubiquity.local -e=/

    · Files copy...

    · Config files creation...

     ╭────────────────────────────────────────────────╮
     │      ■ info : Command line arguments           │
     │      · projectName='html'                      │
     │      · cssFiles=''                             │
     │      · jsFiles=''                              │
     │      · injections=''                           │
     │      · dbName='dsv_ubiquity'                   │
     │      · dbType='mysql'                          │
     │      · serverName='192.168.0.70'               │
     │      · port='3306'                             │
     │      · user='teste'                             │
     │      · password='teste'                 │
     │      · all-models=''                           │
     │      · admin='1'                               │
     │      · themes='semantic'                       │
     │      · siteUrl='https://ubiquity.local'        │
     │      · rewriteBase='/'                         │
     │      · use-cdn=''                              │
     ╰────────────────────────────────────────────────╯

Fatal error: Declaration of Ubiquity\controllers\admin\traits\ModelsTrait::showSimpleMessage($content, $type, $title = NULL, $icon = 'info', $timeout = NULL, $staticName = NULL): Ajax\semantic\html\collections\HtmlMessage must be compatible with Ubiquity\controllers\semantic\MessagesTrait::showSimpleMessage($content, $type, $title = NULL, $icon = 'info', $timeout = NULL, $staticName = NULL, $closeAction = NULL): Ajax\semantic\html\collections\HtmlMessage in C:\Users\Gildonei\AppData\Roaming\Composer\vendor\phpmv\ubiquity-webtools\src\Ubiquity\controllers\admin\UbiquityMyAdminBaseController.php on line 67

Fetching version

C:\wamp64\www\ubiquity>ubiquity version

Fatal error: Declaration of Ubiquity\controllers\admin\traits\ModelsTrait::showSimpleMessage($content, $type, $title = NULL, $icon = 'info', $timeout = NULL, $staticName = NULL): Ajax\semantic\html\collections\HtmlMessage must be compatible with Ubiquity\controllers\semantic\MessagesTrait::showSimpleMessage($content, $type, $title = NULL, $icon = 'info', $timeout = NULL, $staticName = NULL, $closeAction = NULL): Ajax\semantic\html\collections\HtmlMessage in C:\Users\Gildonei\AppData\Roaming\Composer\vendor\phpmv\ubiquity-webtools\src\Ubiquity\controllers\admin\UbiquityMyAdminBaseController.php on line 67

@jcheron
Copy link
Contributor

jcheron commented Jun 27, 2019

only the update of the devtools is global
composer global require phpmv/ubiquity-devtools:dev-master
and Ubiquity version should display:
Ubiquity devtools (1.2.7)
Then you can create a new project:
Ubiquity new test -a
In the new project folder, you can switch all to dev-master:
composer require phpmv/ubiquity:dev-master
composer require phpmv/ubiquity-webtools:dev-master

@gildonei
Copy link
Contributor Author

Step 1: downgraded global ubiquity and webtools - OK

composer global require phpmv/ubiquity-webtools
composer global require phpmv/ubiquity

Step 2: Create a new project
ubiquity new html -a -b="dsv_ubiquity" -s="192.168.0.70" -u="teste" -w="teste" -h="semantic" -i="http://ubiquity.local" -e="/" - OK

Step 3: tried to check ubiquity version - ERROR

C:\wamp64\www\ubiquity\html>Ubiquity version

    · The project folder is C:\wamp64\www\ubiquity\html
     ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
     │      ■ error                                                                                                │
     │                                                                                                             │
     │      · Message : Undefined class constant 'version'                                                         │
     │      · File : C:\Users\Gildonei\AppData\Roaming\Composer\vendor\phpmv\ubiquity-devtools\src\Ubiquity        │
     │      · Line : 423                                                                                           │
     ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Step 4: Inside project folder, switch all to dev-master: OK

composer require phpmv/ubiquity:dev-master
composer require phpmv/ubiquity-webtools:dev-master

Step 5: Tried to get ubiquity version again and got same fatal error before - ERROR

C:\wamp64\www\ubiquity\html>ubiquity version

    · The project folder is C:\wamp64\www\ubiquity\html

Fatal error: Declaration of Ubiquity\controllers\admin\traits\ModelsTrait::showSimpleMessage($content, $type, $title = NULL, $icon = 'info', $timeout = NULL, $staticName = NULL): Ajax\semantic\html\collections\HtmlMessage must be compatible with Ubiquity\controllers\semantic\MessagesTrait::showSimpleMessage($content, $type, $title = NULL, $icon = 'info', $timeout = NULL, $staticName = NULL, $closeAction = NULL): Ajax\semantic\html\collections\HtmlMessage in C:\wamp64\www\ubiquity\html\vendor\phpmv\ubiquity-webtools\src\Ubiquity\controllers\admin\UbiquityMyAdminBaseController.php on line 67

@jcheron
Copy link
Contributor

jcheron commented Jun 27, 2019

Edit manually your global composer.json to remove all unused packages:
in C:\Users\Gildonei\AppData\Roaming\Composer
Then:
composer global update
It seems you have an old version of Ubiquity classes in the global composer file

Then restart the procedure:

only the update of the devtools is global

composer global require phpmv/ubiquity-devtools:dev-master
and Ubiquity version should display:
Ubiquity devtools (1.2.7)
Then you can create a new project:
Ubiquity new test -a
In the new project folder, you can switch all to dev-master:
composer require phpmv/ubiquity:dev-master
composer require phpmv/ubiquity-webtools:dev-master

@gildonei
Copy link
Contributor Author

gildonei commented Jun 27, 2019

Step 1: Remove unused packages - OK

Edit manually your global composer.json to remove all unused packages: in C:\Users\Gildonei\AppData\Roaming\Composer Then: composer global update It seems you have an old version of Ubiquity classes in the global composer file

Result composer.json file

{
    "require": {
        "phpmv/ubiquity-devtools": "dev-master"
    }
}

Step 2: - Check version - OK

C:\wamp64\www\ubiquity>ubiquity version

    · PHP 7.1.9
    · Ubiquity devtools (1.2.7)

Step 3: Create new project - OK

ubiquity new html -a -b="dsv_ubiquity" -s="192.168.0.70" -u="teste" -w="teste" -h="semantic" -i="http://ubiquity.local" -e="/"

Step 4: Check version again (outside project folder) - OK

C:\wamp64\www\ubiquity>ubiquity version

    · PHP 7.1.9
    · Ubiquity devtools (1.2.7)

Step 5: Run in browser http://ubiquity.local - OK

Step 6: Check version again (inside project folder) - ERROR

C:\wamp64\www\ubiquity\html>ubiquity version

    · The project folder is C:\wamp64\www\ubiquity\html
     ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
     │      ■ error                                                                                                │
     │                                                                                                             │
     │      · Message : Undefined class constant 'version'                                                         │
     │      · File : C:\Users\Gildonei\AppData\Roaming\Composer\vendor\phpmv\ubiquity-devtools\src\Ubiquity        │
     │      · Line : 423                                                                                           │
     ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Stoped here - Should I continue and update to dev-master?

@jcheron
Copy link
Contributor

jcheron commented Jun 27, 2019

Yes, for the moment it's normal,
the error comes from the old webtools integrated in Ubiquity 2.1.4 which did not have a constant version

@gildonei
Copy link
Contributor Author

gildonei commented Jun 27, 2019

Continuing

Step 6: Update ubiquity to dev-master (inside project folder) - OK
composer require phpmv/ubiquity:dev-master

Step 7: Run in browser http://ubiquity.local - ERROR

Fatal error: Declaration of Ubiquity\controllers\admin\traits\ModelsTrait::showSimpleMessage($content, $type, $title = NULL, $icon = 'info', $timeout = NULL, $staticName = NULL): Ajax\semantic\html\collections\HtmlMessage must be compatible with Ubiquity\controllers\semantic\MessagesTrait::showSimpleMessage($content, $type, $title = NULL, $icon = 'info', $timeout = NULL, $staticName = NULL, $closeAction = NULL): Ajax\semantic\html\collections\HtmlMessage in C:\wamp64\www\ubiquity\html\vendor\phpmv\ubiquity-webtools\src\Ubiquity\controllers\admin\UbiquityMyAdminBaseController.php on line 67

Step 8: Update webtools to dev-master (inside project folder) - OK
composer require phpmv/ubiquity-webtools:dev-master

Step 9: Run in browser http://ubiquity.local - ERROR

Fatal error: Declaration of Ubiquity\controllers\admin\traits\ModelsTrait::showSimpleMessage($content, $type, $title = NULL, $icon = 'info', $timeout = NULL, $staticName = NULL): Ajax\semantic\html\collections\HtmlMessage must be compatible with Ubiquity\controllers\semantic\MessagesTrait::showSimpleMessage($content, $type, $title = NULL, $icon = 'info', $timeout = NULL, $staticName = NULL, $closeAction = NULL): Ajax\semantic\html\collections\HtmlMessage in C:\wamp64\www\ubiquity\html\vendor\phpmv\ubiquity-webtools\src\Ubiquity\controllers\admin\UbiquityMyAdminBaseController.php on line 67

End of steps

@jcheron
Copy link
Contributor

jcheron commented Jun 27, 2019

Can you try again in the same project:
composer require phpmv/ubiquity-webtools:dev-master#52a5478f7e94f09cf7bc3caaf1eca4cced69f6ef
It's an update to the last commit

@jcheron jcheron reopened this Jun 27, 2019
@gildonei
Copy link
Contributor Author

gildonei commented Jun 27, 2019

Now It works perfectly. Inclusive maintenance section.

@jcheron
Copy link
Contributor

jcheron commented Jul 1, 2019

@gildonei No negative (or positive) feedback on the maintenance part?
Have you tried comingSoon mode as well?

@gildonei
Copy link
Contributor Author

gildonei commented Jul 1, 2019

Hi @jcheron. I didn't had time enought to test this feature until now.
I really enjoyd this feature.

  • Simply to activate/deactivate
  • Schedule for auto deactivate
  • Be able to configure ports, hosts and others URLs.
  • All animations and default text/icon were well choosed.

A great job as always.

Thank you again for all your work.

I think we can close this topic.

@jcheron
Copy link
Contributor

jcheron commented Jul 1, 2019

Thank you for this feedback @gildonei
I will leave this issue open to give others the opportunity to react.
A few acceptance tests, some documentation, and we can integrate this into version 2.2.0

A small correction about deactivation: it is not automatic.
The countdown is only an indication to users.
image

@gildonei
Copy link
Contributor Author

gildonei commented Jul 1, 2019

Deactivation: understood. Anyway it is a good resource for visitors to have an estimated time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted For accepted RFCs (Requests For Changes) Implemented Implemented RFC new feature For new features to test
Projects
None yet
Development

No branches or pull requests

2 participants