WCF icon indicating copy to clipboard operation
WCF copied to clipboard

Improve directory organization

Open TimWolla opened this issue 2 years ago • 1 comments

The current directory organization primarily grew historically without any clear structure. This makes it hard to protect specific directories on non-Apache web servers and raises the chance for conflicts. The latter is especially true for WoltLab Suite Core, it contains quite a few top-level directories, but commonly also all the directories for the installed apps. I don't really want to know what will happen if one attempts to install an application into the images/ directory or the templates/ directory.

Thus the directories should be unified in some organized hierarchy. Ideally splitting that hierarchy between “public” and “private” data, the latter can then be protected with a single and simple rule within the web server configuration.

TimWolla avatar Feb 14 '23 14:02 TimWolla

I don't really want to know what will happen if one attempts to install an application into the images/ directory or the templates/ directory.

The .htaccess might block access to it. But I think preventing those stupid cases explicitly by adding logic is nonsense since you'd have to do this recursive for every single system generated directory. Even changing the structure by moving everything into public and private doesn't prevent those cases, it just reduces accidental naming collisions since images might be used for a gallery.

However I'd support changing the directory structure to a more clear and universal structure. Just an idea:

acp/
 ├─ index.php
private/
 ├─ acp/
 │  ├─ style/
 │  ├─ templates/
 │  │  ├─ compiled/
 ├─ cache/
 ├─ frontend/
 │  ├─ style/
 │  ├─ templates/
 │  │  ├─ compiled/
 ├─ language/
 ├─ lib/
 ├─ log/
 ├─ media/
 │  ├─ attachments/
 │  ├─ media/
 ├─ scripts/
 │  ├─ database/
 │  ├─ install/
 │  ├─ uninstall/
 ├─ tmp/
 ├─ .htaccess
 ├─ global.php
public/
 ├─ font/
 ├─ images/
 │  ├─ favicon/
 │  ├─ flags/
 │  ├─ icon/
 │  ├─ rank/
 │  ├─ reaction/
 │  ├─ smilies/
 │  ├─ trophy/
 │  ├─ user/
 │  │  ├─ avatar/
 │  │  ├─ coverPhoto/
 ├─ js/
 ├─ sitemaps/
 │  ├─ sitemaps.xml
 ├─ style/
index.php

mutec avatar Feb 21 '23 20:02 mutec