Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for chroot'ed environments #41

Open
h3artbl33d opened this issue Feb 21, 2021 · 2 comments
Open

Add support for chroot'ed environments #41

h3artbl33d opened this issue Feb 21, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@h3artbl33d
Copy link

h3artbl33d commented Feb 21, 2021

Thank you tremendously for continuing Cachet development :) I'd like to add a feature request, if you are open for it. I do miss a setting in .env or a configurable setting to support the chroot functionality of PHP-FPM.

FPM supports setting a custom chroot - but the CLI interpreter doesn't support this functionality. However, using CLI is required to install Cachet, to run artisan and it's the interpreter used with cron. This discrepancy between the two interpreters break the application.

Example:

  • Cachet lives in /var/www/cachet
  • The FPM chroot is set to /var/www
  • Running composer install and php artisan cachet:install puts the full path in bootstrap/cache/config.php

In this example, accessing Cachet from the webbrowser fires up FPM which tries to pull includes from /var/www/var/www/cachet/ - and thus throws an internal server error.

Proposed fix:

The ability to define the chroot in .env - in conjunction with detecting which interpreter is used (if that option is not set to null) gives Cachet the ability to run from chroot environments. In the above example, that prefix would be /var/www - which boils down to this path definition:

'path' => ((php_sapi_name() == 'cli') ? '/var/www' : '') . '/cachet/storage',

I hope this makes sense :)

@sedan07
Copy link

sedan07 commented Feb 22, 2021

@h3artbl33d thanks for the issue. Good idea 👍 , i'll look into this.

@sedan07 sedan07 added the enhancement New feature or request label Feb 22, 2021
@h3artbl33d
Copy link
Author

Awesome, thank you :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants