elements-at / ProcessManager

Manage processes in Pimcore
Other
45 stars 31 forks source link

File downloads do not work if Pimcore private var directory is outside the project root directory. #147

Closed elements-team closed 2 years ago

elements-team commented 2 years ago

Use case / Problem:

In a pipeline deployment setup, the private var is set to be outside the PROJECT_ROOT directory:

PRESALES_PIMCORE_PRIVATE_VAR="/home/presales/var_pimcore/private"

But for the process manager, files must be always located inside the root directory:

Solution Suggestion

1) Add a setter to overwrite the root directory with the project specific root. Flexible + easy to extend; ignore security risk? 2) Always use the PIMCORE_SYSTEM_TEMP_DIRECTORY as the root instead of PIMCORE_PROJECT_ROOT (simple + effective solution, but probably isn't downward compatible).

ctippler commented 2 years ago

Hi,

maybe we add a property public $isAbsoluteFilePath = false;

to the Action\Download.php class. When this is set to "true" -> we don't prepend the PIMCORE_PROJECT_ROOT . So you can store the absolute File path and retrive it later on?

I guess it's just important that it is backward compatible :-)

Best regards

andreas-gruenwald commented 2 years ago

Good idea. I added a PR (already tested with my setup): https://github.com/elements-at/ProcessManager/pull/148/commits/9ab71376833552fb750324b454d18f2e8ff16326

ctippler commented 2 years ago

Added with PR - thx