Config Suite

A set of improvements to Drupal's configuration management system that removes the Site UUID check and provides automatic import/export functionality.

config_suite
161 sites
42
drupal.org

インストール

Drupal 11, 10, 9 v2.0.5
composer require 'drupal/config_suite:^2.0'

概要

Config Suiteは、DrupalコアのConfiguration管理システムを強化し、バージョン管理ワークフローでConfigurationをより簡単に扱えるようにします。このモジュールは、異なるDrupalサイト間でConfigurationを共有または再利用する際の一般的な問題点に対処します。

主な機能として、Configurationインポート時のSite UUID検証を削除します。通常、この検証により異なるDrupalインストールからのConfigurationインポートが阻止されます。これにより「Site UUID in source storage does not match the target storage」エラーが解消され、同じサイトの異なるコピーで作業する開発者が回避策なしでConfigurationを共有できるようになります。

さらに、Config Suiteは自動化機能を提供し、フォームが保存されるたびにConfiguration変更をsyncフォルダに自動エクスポートしたり、管理者がサイトにアクセスした際に保留中のConfiguration変更を自動インポートしたりできます。これらの機能により、開発環境でのConfigurationワークフローが効率化されます。

Features

  • Configurationインポート時のSite UUID検証をバイパスし、異なるDrupalインストール間でConfigurationを共有可能
  • Configuration関連フォームが保存されるたびにsyncフォルダへ自動エクスポート
  • 管理者がサイトにアクセスし、syncフォルダが更新されている場合に自動インポート
  • モジュールインストール時にすべてのアクティブなConfigurationをsyncフォルダにエクスポート
  • 包括的なConfiguration同期のためのConfiguration collectionをサポート

Use Cases

Multi-developer team workflow

When multiple developers work on the same Drupal project with separate local installations, each site has a different UUID. Without Config Suite, importing configuration from a colleague's work would fail with the UUID mismatch error. Config Suite allows developers to freely share configuration files through version control without UUID conflicts.

Site migration or cloning

When creating a new site based on configuration from an existing site, or when migrating configuration between staging/production environments with different UUIDs, Config Suite allows the configuration to be imported without manual UUID manipulation or workarounds.

Automated development workflow

Enable both automatic import and export to create a seamless development experience. When you make configuration changes through the UI, they're automatically written to the sync folder for immediate commit to version control. When a colleague's configuration changes are pulled from the repository, they're automatically applied on your next page load.

Configuration reuse across projects

Create reusable configuration snippets that can be applied to any Drupal site regardless of its UUID. This is particularly useful for agencies or developers who maintain similar configurations across multiple client sites.

Tips

  • Config Suite is particularly useful during development but consider disabling automatic features in production environments where configuration changes should be more controlled.
  • The automatic import feature only runs for users with the administrator role for security reasons.
  • Upon module installation, all active configuration is exported to the sync folder, ensuring you start with a complete configuration baseline.
  • A video introduction to Config Suite is available from BadCamp: https://www.youtube.com/watch?time_continue=112&v=02IJGgGPBAw

Technical Details

Admin Pages 1
Import and Export your configuration, or automate the configuration workflow. /admin/config/config_suite/admin_settings

Configure automatic configuration import and export settings for Config Suite. This page allows you to enable or disable automatic synchronization of configuration between the active storage and the sync folder.

権限 1
Administer Config Suite settings

Allows users to access and modify Config Suite configuration settings at the admin page. Required to change automatic import/export settings.

Hooks 2
hook_install

Exports all active configuration to the sync folder upon module installation, ensuring the sync folder is immediately populated with current configuration.

hook_help

Provides help text for the module on the help page.

Troubleshooting 3
Configuration changes not being automatically imported

Ensure the automatic import setting is enabled, and that the logged-in user has the 'administrator' role. The automatic import only triggers for administrator users.

Configuration changes not being automatically exported

Verify that automatic export is enabled in Config Suite settings. Also ensure that the sync folder is writable by the web server.

Warning messages about config files not found in collections

These warnings may appear in logs when configuration collections don't contain the specific configuration item being saved. This is usually harmless and indicates the configuration doesn't exist in that particular collection.

Security Notes 3
  • The automatic import feature only executes for users with the administrator role, preventing unauthorized configuration changes.
  • This module bypasses the Site UUID check which is a security feature in core Drupal. While convenient for development, understand that this removes a safeguard designed to prevent accidental configuration overwrites between different sites.
  • Consider the security implications before enabling this module on production sites, as automatic configuration import could potentially be exploited if an attacker gains write access to the sync folder.