From 13c5a31622a1da31e6f278942eb3b2abf83d0302 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Mon, 10 Aug 2026 14:57:44 +0100 Subject: [PATCH 1/2] Fixes installation --- commands/web/drupal | 32 ++++++----- core-dev/src/Command/AdminLoginCommand.php | 2 +- core-dev/src/Command/CacheCommand.php | 2 +- core-dev/src/Command/ModuleInstallCommand.php | 2 +- core-dev/src/Command/TestCommand.php | 2 +- core-dev/src/Command/UninstallCommand.php | 2 +- web-build/Dockerfile.chromium | 55 +++++++++++++++++++ 7 files changed, 77 insertions(+), 20 deletions(-) diff --git a/commands/web/drupal b/commands/web/drupal index 6f88c66..01f35be 100755 --- a/commands/web/drupal +++ b/commands/web/drupal @@ -40,20 +40,22 @@ $loader->addPsr4('DrupalCoreDev\\', $composer_root . '/.ddev/core-dev/src/'); $application = new Application('drupal', \Drupal::VERSION); -$application->add(new InstallCommand($loader)); -$application->add(new UninstallCommand()); -$application->add(new ModuleInstallCommand($loader)); -$application->add(new CacheCommand($loader)); -$application->add(new AdminLoginCommand($loader)); -$application->add(new GenerateTheme()); -$application->add(new TestCommand()); -$application->add(new TestExtensionsCommand()); -$application->add(new TestBrowserCommand()); -$application->add(new LintPhpCsCommand()); -$application->add(new LintPhpStanCommand()); -$application->add(new LintCssCommand()); -$application->add(new LintJsCommand()); -$application->add(new LintCspellCommand()); -$application->add(new LintCommand()); +$application->addCommands([ + new InstallCommand($loader), + new UninstallCommand(), + new ModuleInstallCommand($loader), + new CacheCommand($loader), + new AdminLoginCommand($loader), + new GenerateTheme(), + new TestCommand(), + new TestExtensionsCommand(), + new TestBrowserCommand(), + new LintPhpCsCommand(), + new LintPhpStanCommand(), + new LintCssCommand(), + new LintJsCommand(), + new LintCspellCommand(), + new LintCommand(), +]); $application->run(); diff --git a/core-dev/src/Command/AdminLoginCommand.php b/core-dev/src/Command/AdminLoginCommand.php index 07a8b89..0b22a6f 100644 --- a/core-dev/src/Command/AdminLoginCommand.php +++ b/core-dev/src/Command/AdminLoginCommand.php @@ -11,7 +11,7 @@ class AdminLoginCommand extends BootCommand { /** * {@inheritdoc} */ - protected function configure() { + protected function configure(): void { $this->setName('login') ->setDescription('Generates a one-time login link for User 1'); diff --git a/core-dev/src/Command/CacheCommand.php b/core-dev/src/Command/CacheCommand.php index 19e4398..1a1172b 100644 --- a/core-dev/src/Command/CacheCommand.php +++ b/core-dev/src/Command/CacheCommand.php @@ -10,7 +10,7 @@ class CacheCommand extends BootCommand { /** * {@inheritdoc} */ - protected function configure() { + protected function configure(): void { parent::configure(); $this->setName('cache') ->setDescription('Clears all caches and the container registry'); diff --git a/core-dev/src/Command/ModuleInstallCommand.php b/core-dev/src/Command/ModuleInstallCommand.php index 8b43c9e..531987a 100644 --- a/core-dev/src/Command/ModuleInstallCommand.php +++ b/core-dev/src/Command/ModuleInstallCommand.php @@ -12,7 +12,7 @@ class ModuleInstallCommand extends BootCommand { /** * {@inheritdoc} */ - protected function configure() { + protected function configure(): void { parent::configure(); $this->setName('module:install') ->setDescription('Install modules') diff --git a/core-dev/src/Command/TestCommand.php b/core-dev/src/Command/TestCommand.php index 5d439d0..21c1ae3 100644 --- a/core-dev/src/Command/TestCommand.php +++ b/core-dev/src/Command/TestCommand.php @@ -14,7 +14,7 @@ class TestCommand extends Command { /** * {@inheritdoc} */ - protected function configure() { + protected function configure(): void { $this->setName('test') ->setDescription('Run all core tests using the run-tests.sh script. You probably don\'t want to do this - instead run PHPUnit directly on selected tests e.g. ddev phpunit core/modules/sdc/tests'); diff --git a/core-dev/src/Command/UninstallCommand.php b/core-dev/src/Command/UninstallCommand.php index e847b45..11f9cc9 100644 --- a/core-dev/src/Command/UninstallCommand.php +++ b/core-dev/src/Command/UninstallCommand.php @@ -12,7 +12,7 @@ class UninstallCommand extends Command { /** * {@inheritdoc} */ - protected function configure() { + protected function configure(): void { $this->setName('uninstall') ->setDescription('Uninstall Drupal by deleting settings.'); } diff --git a/web-build/Dockerfile.chromium b/web-build/Dockerfile.chromium index 07d9126..349f6e1 100644 --- a/web-build/Dockerfile.chromium +++ b/web-build/Dockerfile.chromium @@ -16,3 +16,58 @@ RUN apt-get install -y --no-install-recommends \ libflac12 \ libopenh264-7 \ && rm -rf /var/lib/apt/lists/* + +# 3. Apt config for the layers below. The snapshot repos above are "expired" by design, so +# make the valid-until exemption permanent rather than a per-command flag. The pins make the +# bookworm snapshot a last resort: anything trixie can satisfy comes from trixie, so we only +# borrow from bookworm where chromium 143 genuinely needs it (the sonames pinned above). +RUN echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99no-check-valid-until && \ + printf 'Package: *\nPin: release n=bookworm\nPin-Priority: 1\n' \ + > /etc/apt/preferences.d/bookworm-last-resort && \ + printf 'Package: *\nPin: release n=bookworm-security\nPin-Priority: 1\n' \ + >> /etc/apt/preferences.d/bookworm-last-resort + +# 4. Browser system libraries for Playwright, i.e. the "tools" and "chromium" entries of the +# debian13-x64 map in playwright-core 1.62.1 (lib/server/registry/nativeDeps.ts). Listed +# explicitly instead of calling `npx playwright install-deps` so the image does not depend on +# whatever npm serves at build time, matching how chromium and the apt snapshot are pinned above. +# To regenerate after a Playwright bump: +# docker run --rm ddev/ddev-webserver: npx --yes playwright@ install-deps --dry-run +# Most of the chromium entries are already satisfied by the Debian chromium package installed +# above; the four libatk/libasound names resolve to Debian's t64 transition packages, which +# provide the same sonames and leave chromium itself untouched. +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + xvfb \ + fonts-noto-color-emoji \ + fonts-unifont \ + libfontconfig1 \ + libfreetype6 \ + xfonts-scalable \ + fonts-liberation \ + fonts-ipafont-gothic \ + fonts-wqy-zenhei \ + fonts-tlwg-loma-otf \ + fonts-freefont-ttf \ + libasound2t64 \ + libatk-bridge2.0-0t64 \ + libatk1.0-0t64 \ + libatspi2.0-0t64 \ + libcairo2 \ + libcups2t64 \ + libdbus-1-3 \ + libdrm2 \ + libgbm1 \ + libglib2.0-0t64 \ + libnspr4 \ + libnss3 \ + libpango-1.0-0 \ + libx11-6 \ + libxcb1 \ + libxcomposite1 \ + libxdamage1 \ + libxext6 \ + libxfixes3 \ + libxkbcommon0 \ + libxrandr2 \ + && rm -rf /var/lib/apt/lists/* From 4d9a04629ba436f37bb5b1f8fd722c1bfbf35790 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Mon, 10 Aug 2026 16:17:41 +0100 Subject: [PATCH 2/2] Fixes installation --- README.md | 6 +++- commands/web/drupal | 2 +- core-dev/src/Command/InstallCommand.php | 48 +++++++++++++++++++++++++ install.yaml | 1 + 4 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 core-dev/src/Command/InstallCommand.php diff --git a/README.md b/README.md index b6c63fa..c20479d 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,10 @@ command. This allows you to perform some basic tasks without needing to install # Run "ddev drupal install" to see all available options ddev drupal install standard +# Reset the site so it can be installed again +# Use this rather than deleting sites/default/files and settings.php by hand +ddev drupal uninstall + # Run PHPUnit tests ddev phpunit core/modules/announcements_feed @@ -52,7 +56,7 @@ ddev nightwatch --skiptags core Run a single test ``` -ddev nightwatch tests/Drupal/Nightwatch/Tests/exampleTest.js +ddev nightwatch tests/Drupal/Nightwatch/Tests/a11yTestAdmin.js ``` a11y tests for both the admin and default themes diff --git a/commands/web/drupal b/commands/web/drupal index 01f35be..77cd735 100755 --- a/commands/web/drupal +++ b/commands/web/drupal @@ -14,9 +14,9 @@ */ use Drupal\Core\Command\GenerateTheme; -use Drupal\Core\Command\InstallCommand; use DrupalCoreDev\Command\AdminLoginCommand; use DrupalCoreDev\Command\CacheCommand; +use DrupalCoreDev\Command\InstallCommand; use DrupalCoreDev\Command\LintCommand; use DrupalCoreDev\Command\LintCspellCommand; use DrupalCoreDev\Command\LintCssCommand; diff --git a/core-dev/src/Command/InstallCommand.php b/core-dev/src/Command/InstallCommand.php new file mode 100644 index 0000000..9316b01 --- /dev/null +++ b/core-dev/src/Command/InstallCommand.php @@ -0,0 +1,48 @@ +classLoader, FALSE))->getAppRoot(); + $site_path = $root . '/' . $this->getSitePath(); + $settings = $site_path . '/settings.php'; + + if (!is_dir($site_path)) { + mkdir($site_path, 0775, TRUE); + } + elseif (!is_writable($site_path)) { + // A site installed before this command existed left it hardened. + chmod($site_path, 0755); + } + + // Core skips its own copy when settings.php is already there, so this is + // the only chance to get the setting in before the installer reads it. + if (!file_exists($settings)) { + copy($root . '/sites/default/default.settings.php', $settings); + file_put_contents($settings, "\n\$settings['skip_permissions_hardening'] = TRUE;\n", FILE_APPEND); + } + + return parent::execute($input, $output); + } + +} diff --git a/install.yaml b/install.yaml index 13e6f88..844b467 100644 --- a/install.yaml +++ b/install.yaml @@ -14,6 +14,7 @@ project_files: - core-dev/src/Command/AdminLoginCommand.php - core-dev/src/Command/BootCommand.php - core-dev/src/Command/CacheCommand.php + - core-dev/src/Command/InstallCommand.php - core-dev/src/Command/TestCommand.php - core-dev/src/Command/TestBrowserCommand.php - core-dev/src/Command/TestExtensionsCommand.php