Open jtojnar opened 7 years ago
Nice.
index.php
in the projet root cannot be avoided, although for people selfoss on less restricted environments, putting the libs out of the document root is desirable. We should support both.tests
directory to the root. Other possible location is src/tests
, which could make linting them easier but they would have to be explicitly excluded from the build. For that reason, placing tests next to the file/class they test is out of the game.Actually, I am one of those people.
The problem could be fixed by placing an additional .htaccess
in the project root, that would rewrite to the document root. In pseudo-code:
if $url begins with 'public/'
remove prefix 'public/'
rewrite (.*) to public/$1
It might be slightly confusing what the document root should be, but that could be rectified in the docs.
Keeping the index.php
in the project root would mean one fewer .htaccess
but there would need to be access control at least for the data
directory.
With #1137, we will be one step closer:
The existing structure is unnecessarily complicated:
Goals
chmod
ing as few directories as possible).Proposed directory structure
The
public
directory can either be set as document root of virtual host or there can be a simple.htaccess
in the parent directory.Further goals to consider
config.ini
,data
is thus a good location for it.templates
andassets
directories, only keeping the API,favicons
andthumbnails
.public
anddata
directories would need to be kept outside.Simpler .htaccess