CLI/Drush cannot do file checks directly

Created on 16 June 2024, 13 days ago
Updated 17 June 2024, 12 days ago

Problem/Motivation

Because drush is usually running drupal directly important checks on files modification possibilities get no or often wrong results.
This is also related to ✨ "Safe file system permissions" should test the ownership of files and directories Closed: outdated .

Steps to reproduce

For example create a folder "test" in webroot and make is writable by the cli user itself and the webserver. The GUI webserver check detects it correctly but not drush.

Proposed resolution

The minimum we need is to know which system user e.g. it's posix uid is running the related webserver/php process. This can be provided by setting.local.php. Easier to use would be an own protected route only to be called via cli which just returns this uid and guid information. With this information we can do fast tests. Maybe easier to code but with the limitations of the webserver would be an option to run checks through a route.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany C-Logemann Frankfurt/M, Germany

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @C-Logemann
  • πŸ‡©πŸ‡ͺGermany C-Logemann Frankfurt/M, Germany

    Currently setServerData() is just returning null on cli usage (see also πŸ› Get server uid function return unexpected type null Active . This is avoids corrects tests but even if we just open it would get wrong values of the file owner and they would be store in state api.
    Even if the current code will not mess up with the state API storage and cli can get correct serverdata.- This only would be available after a successful check via GUI. Beside the basic auth problematic (see related issue) this cann not work on a fresh test system e.g. in CI-Workflow.

  • πŸ‡©πŸ‡ͺGermany C-Logemann Frankfurt/M, Germany

    setServerData() is currently triggered via cron. This could be an interface to run cron via http request. But in CI situations cron isn't always wanted depending on the system needs.

Production build 0.69.0 2024