Module Description
This module allows to lock any configuration changes done via the Drupal admin UI. This can be useful in scenarios where for example configuration changes should not be done on the production environment, but only on staging or local environments.

To enable readonly mode, enable this module and add this to your settings.php:

$settings['config_readonly'] = TRUE; To lock production and not other environments, your code in settings.php might be a conditional on an environment variable like:

if (isset($_ENV['AH_SITE_ENVIRONMENT']) && $_ENV['AH_SITE_ENVIRONMENT'] === 'prod') { $settings['config_readonly'] = TRUE; } The following approaches are somewhat discouraged since they may allow anyone with Drush or shell access to bypass or disable the protection and change configuration in production.

To allow all changes via the command line and enable readonly mode for the UI only:

if (PHP_SAPI !== 'cli') { $settings['config_readonly'] = TRUE; } You could similarly toggle read-only mode based on the presence or absence of a file on the webserver (e.g. in a location outside the docroot).

if (!file_exists('/home/myuser/disable-readonly.txt')) { $settings['config_readonly'] = TRUE; } You may whitelist forms so that their config may be changed on the live site. See the following documentation for more information:

https://git.drupalcode.org/project/config_readonly/blob/HEAD/README.txt

Project Usage
3993
Creation Date
Changed Date
Security Covered
Covered By Security Advisory
Version Available
Production
Module Summary
This module aims to solve the problem of locking configuration changes made via the Drupal admin UI, particularly in scenarios where changes should not be made on production environments but only on staging or local environments.
Data Name
config_readonly

OPENAI CHATBOT

OPENAI CHATBOT

12:23:45
Generic Chatbot
Hi, I'm a Drupal module expert powered by OpenAI, answering your questions about the Drupal module ecosystem. How can I be helpful today? Please note that we will log your question.