[5.0] Introduce a CLI UI for creating a public folder#41446
[5.0] Introduce a CLI UI for creating a public folder#41446HLeithner merged 46 commits intojoomla:5.0-devfrom
Conversation
e8a3ac9 to
83acda1
Compare
| || !mkdir($folder . '/api/includes', 0755, true) | ||
| || !mkdir($folder . '/includes', 0755) | ||
| ) { | ||
| throw new \Exception('Unable to write on the given directory, check the permissions', 200); |
There was a problem hiding this comment.
| throw new \Exception('Unable to write on the given directory, check the permissions', 200); | |
| throw new \Exception('Unable to write on the given directory, check the permissions', 200); |
should that be "unable to create the ..."
you call it a folder elsewhere not a directory
There was a problem hiding this comment.
Legit, tbh let's wait for someone from the security/maintainers validate this before wasting our time here
Signed-off-by: Dimitris Grammatikogiannis <dg@dgrammatiko.dev>
Signed-off-by: Dimitris Grammatikogiannis <dg@dgrammatiko.dev>
Signed-off-by: Dimitris Grammatikogiannis <dg@dgrammatiko.dev>
Signed-off-by: Dimitris Grammatikogiannis <dg@dgrammatiko.dev>
a48f883 to
10f6d6b
Compare
|
Here is my reference implementation with the update pr #41570 Root index.php <?php
/**
* @package Joomla.Site
*
* @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
define('JPATH_ROOT', "/web/joomla.domain.tld");
define('JPATH_BASE', JPATH_ROOT);
define('JPATH_PUBLIC', "/web/joomla.domain.tld/public");
require_once JPATH_BASE . '/index.php';Administrator and API index.php <?php
/**
* @package Joomla.Site
*
* @copyright (C) 2005 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
define('JPATH_ROOT', "/web/joomla.domain.tld");
define('JPATH_BASE', JPATH_ROOT . "/administrator"); // -->> change this to api for api folder <<--
define('JPATH_PUBLIC', "/web/joomla.domain.tld/public");
require_once JPATH_BASE . '/index.php';additional to this you only have the symlink to .htaccess, robots.txt of course make sense too. that's it everything else can be removed. |
|
btw. it's also possible to do this from web installation and afterwards in the global configuration. Additionally this could be configure able from .htaccess with a simple rewrite rule, but that's not untested by me. |
Applied. Just as a recap the helper is:
|
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Brian Teeman <brian@teeman.net>
|
Thanks, documentation needed and some improvement, but I would like to have this in beta1 so people could test this feature. |
|
@HLeithner should I do the docs on a |
|
migration in the manual, and installation and if we have already something it good to mention it in security |
Pull Request for Issue # .
Summary of Changes
joomla.phpCLI:3rd Part Devs impact:
Another possible conflict might be that most folders in the public folder would get by default an htaccess file with
<files>deny from all</files>, meaning NO MORE PHP FILES insidemedia,imagesand any other media manager storage folder. If your extension is placing PHP files in these folders you're doing it very wrong, please consider moving them to their appropriate folder.Have some input? Please share it..
Testing Instructions
Testing a NEW installation
cd installationphp joomla.php installTesting an EXISTING installation
Download the package for the GitHub or check out this PR
go to the
clifolder in your root Joomla installation:cd clirun the command:
php joomla.php site:create-public-folderinsert the FULL path for the public folder, ie
Switch your server to the new directory.
Actual result BEFORE applying this Pull Request
Expected result AFTER applying this Pull Request
Link to documentations
WIP
@SniperSister @HLeithner @wilsonge thoughts?
@Hackwar I would appreciated some fixes here and some help for the installation CLI