User tests: Successful: Unsuccessful:
Pull Request for Issue # .
joomla.php
CLI:site
site:create-public-folder Create a public folder
Please enter the absolute path to the public folder:
Hmm, now that I'm thinking about 3rd PD maybe a simple XML line like the following is all that's needed. We parse all the admin component manifests and symlink the entry points
<exposed-entrypoints>
<path>administrator/components/com_foo/dangerous-entry.php</path>
<path>administrator/components/com_foo/another-dangerous-entry.php</path>
</exposed-entrypoints>
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 inside media
, images
and 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..
cd installation
php joomla.php install
Download the package for the GitHub or check out this PR
go to the cli
folder in your root Joomla installation: cd cli
run the command: php joomla.php site:create-public-folder
Switch your server to the new directory.
WIP
@SniperSister @HLeithner @wilsonge thoughts?
@Hackwar I would appreciated some fixes here and some help for the installation CLI
Category | ⇒ | Libraries |
Status | New | ⇒ | Pending |
Labels |
Added:
PR-5.0-dev
|
Category | Libraries | ⇒ | Administration com_admin Libraries |
Category | Libraries Administration com_admin | ⇒ | Administration com_admin Installation Libraries |
Category | Libraries Administration com_admin Installation | ⇒ | Installation Libraries |
Title |
|
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.
RewriteEngine On
RewriteRule ^(.*)$ public/$1
Here is my reference implementation
Applied. Just as a recap the helper is:
symlinking the extract.php
symlinking the media folder
symlinking all the folders defined in the filesystem-local plugin
creating the entry points index.php, administrator/index.php and api/index.php
copying .htaccess or htaccess.txt and robots.txt
As I commented in adjacent PR, it would be better to do it in separated file, instead of in index.php.
The index.php may be updated at some point, and there no way to run the CLI after update, again (I mean automaticaly from update script).
@Fedik the updates are covered as the generated indexes containing only the extra defines and a require to the actual index: https://github.com/joomla/joomla-cms/pull/41446/files#diff-c56b0e04d98c726402852cab3f325feb5e87f42c934256fac6ba2458100365a7R104-R117
new index.php suggestion:
<?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
*/
$applicationPath = '/administrator'; // site application is an empty string and api application is '/api'
require_once dirname(__DIR__) . '/defines.php';
require_once JPATH_BASE . '/index.php';
new defines.php in public root folder suggestion:
<?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 . $applicationPath);
define('JPATH_PUBLIC', "/web/joomla.domain.tld/public");
unset($applicationPath);
I would like to avoid add more then one place with the pathes, because at the moment if you move a joomla site from one server to another you need exactly zero changes to the config (at least then it runs). Now you should need to touch 3 files and a symlink...
maybe unset the variable in the index.php instead of the defines.php.... would be cleaner
Ah wait, I misunderstood everything, sorry.
The index is only for publick folder, not core one.
Then can stay as you already made.
Sorry for disturbing :)
maybe unset the variable in the index.php instead of the defines.php.... would be cleaner
I missed that
Labels |
Added:
Feature
|
Category | Libraries Installation | ⇒ | Installation Language & Strings Libraries |
Labels |
Added:
Language Change
|
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-09-05 08:07:14 |
Closed_By | ⇒ | HLeithner |
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 deployment
category or something else (security?)
migration in the manual, and installation and if we have already something it good to mention it in security
Here is my reference implementation with the update pr #41570
Root index.php
Administrator and API index.php
additional to this you only have the symlink to
extract.php
in admin/com/com_joomlaupdate/extract.php and the the media and image folder in root..htaccess, robots.txt of course make sense too.
that's it everything else can be removed.