webksde / ddev-vscode-devcontainer-drupal-template

Drupal DDEV based development container with attached Visual Studio Code
23 stars 3 forks source link

Private file system not functional #94

Closed JPustkuchen closed 2 years ago

JPustkuchen commented 2 years ago

This can be tested using backup_migrate and trying to restore a backup by upload. The file can not be written.

using ddev drowl-init the file system is configured as follows:

Public file system path
sites/default/files
A local file system path where public files will be stored. This directory must exist and be writable by Drupal. This directory must be relative to the Drupal installation directory and be accessible over the web. This must be changed in settings.php
Public file base URL
https://ddev-vscode-devcontainer-drupal9-template.ddev.site/sites/default/files
The base URL that will be used for public file URLs. This can be changed in settings.php
Private file system path
../files/private
An existing local file system path for storing private files. It should be writable by Drupal and not accessible over the web. This must be changed in settings.php
Temporary directory
../tmp
A local file system path where temporary files will be stored. This directory should not be accessible over the web. This must be changed in settings.php.

But ../files does not exist when ddev ssh'ing into the web container. But even with it created, it doesn't seem to work.

Watchdog says:

Warning: opendir(private://backup_migrate/): failed to open dir: "Drupal\Core\StreamWrapper\PrivateStream::dir_opendir" call failed in Drupal\backup_migrate\Core\Destination\DirectoryDestination->getAllFileNames() (line 252 of /var/www/html/web/modules/contrib/backup_migrate/src/Core/Destination/DirectoryDestination.php)

We should discuss how to solve this, as typically the "files" directory is on the same level as the "web" directory...

joshsedl commented 2 years ago

Fixed in https://github.com/webksde/ddev-vscode-devcontainer-drupal9-template/commit/6660a1a5a62458b06e26b13e56295365859f77bf, we are creating the private files directory on container setup, this way it is also present in the web container: image