Read-only mode
Would it be possible to set up something like a read-only mode for Drupal Console?
This would be particularly helpful for production/live environments. This way, it can be used to analyse problems with the site or gather information, but it will stop the user from making changes to the site by accident.
I have for example accidentally imported a database dump into the live environment, when I actually wanted to import it to dev or test. If there was something like a read-only mode that I would have to actively switch off first, that would prevent me from doing such silly things again.
A possible solution could be to use different database credentials for Drupal and Drupal Console, and then the permissions for the MySQL users can be fine-tuned to obtain the desired behaviour.
Hi @PhilippVerpoort
We are thinking in a create a separate repo to enable do this in a production environment
"require": {
"drupal/console": "^2",
"drupal/console-core": "^2",
},
and include this line in a dev environment
"require-dev": {
"drupal/console-dev": "^1"
"drupal/console-develop-tools": "^1"
}
The package drupal/console will contains only essencials command to be run in production and drupal/console-dev package will be a version of our current Drupal Console package.
The Drupal Console Develop tools would be a rename for our current repo https://github.com/weknowinc/drupal-console-develop
This is part of our ideas for Drupal Console 2.0 that I have been talking with @jmolivas and @jibran
Please let me know if this sounds like a plan for you.
This does sound sensible! The commands you want to be able to use in prod and dev environment are certainly different (there's certain dev commands that you don't want to be available in prod), and this is already reflected by e.g. the Drupal devel module, which is also only recommended to be installed in a dev environment.
Could you advise me on how custom Console commands would be treated? Would there be some kind of flag to highlight whether a contributed command by another module is of type "prod" or "dev"?
Hi @PhilippVerpoort
Let us work in following 1.9.x release to settle down the idea.
Do you have a list of command that you want to remain in production level?
Apologies, I never followed this up. Have you made any progress with this?
As I proposed before, this should be a feature in version 2.0 for Drupal 9
Cool, sounds good! No worries, no pressure, was just interested to see if you've had any further thoughts on this. So, I took a quick look at what Drupal Console commands I would consider suitable for a live environment:
cache config create cron database:dump (only this one! certainly not database:restore or database:drop! very dangerous commands in production environment) role site:maintenance site:status taxonomy theme user views
Awesome that is a great input to work in that direction @PhilippVerpoort