-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 static files server #9294
base: master
Are you sure you want to change the base?
Add static files server #9294
Conversation
Nice PR! |
@johndoh @mvorisek @EdouardVanbelle @cmollekopf what do you think? |
a) b) On Windows, symlinks are very mildly supported and even on NTFS they are not usually extracted (by common archive utilities) from the release archvives. c) It will add more load to the webserver as the static content requests will have to go thru PHP, but it seems like caching is implemented so this should not be an issue, actually it can improve performance on webservers with wrongly configured caching. To sum this up: Given a) this PR helpful for non-Apache based webservers like nginx (with non-ignoreable marker share). Given a) and c) this PR should be not the default/only static files routing solution when Given b), this PR is needed (for restricting access to all files). All symlinks can/should be removed then. People are lazy and how many of them configure |
The point is to remove current |
Inexperienced users should not be forced to change their webserver route to So there needs to a be
The problem of serving static files and securing other files is not related to this repo only. I would prefer some solution using separate repo. Maybe there is some package which solves it well already. |
I second @mvorisek's thoughts about Windows. If there are any contributors who run a Windows bassed setups may be they could comment? If
I tried serving a non-supported file from a test plugin. Its a very rough test but if you have Small thing but |
We could make use of https://github.com/Stadly/FileWaiter. I didn't find other library that isn't part of some big framework. I really see no problem in forcing users to use As for performance, I think it will be good enough. Users that require something really fast can setup a separate static assets server, I suppose. Regarding Windows and links. The only problem (link) would be the installer. I suppose we could provide install.php instead of a link. |
I do want to use Changing the document root back to the actual root (without public_html) will load all the static files correctly. What do I wrong today? I understand why people won't use Ps. the guide told me to use the normal root first during the installation, and after the installation change the root. Which I did now. EDIT: Yes, I use Nginx not Apache. I did already add the additional security steps to Nginx (I was hoping no more sections where needed to get public_html working with Nginx), snippet: location ~ ^/(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
deny all;
}
location ~ ^/(bin|SQL|config|temp|logs)/ {
deny all;
} |
I found it.. The wiki guide told me to use FTP (eg. FileZilla) to copy the data to the server, but it seems like it's not copying the symlinks from |
Please be sure to update the documention wiki page with some additional information that copying those files via sftp will not copy symlinks. Or either describe a better installation method instead..? |
program/lib/Roundcube/bootstrap.php
Outdated
if (!function_exists('str_starts_with')) { | ||
function str_starts_with(string $haystack, string $needle) { | ||
return strlen($needle) === 0 || strpos($haystack, $needle) === 0; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/atk4/core/blob/5.2.0/composer.json#L35-L38 would be better solution as installed dependencies are required in all cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. Anyway, we should consider bumping PHP version requirement to 8.1 for the next Roundcube version, especially if it will be a bump to 2.0.
In an attempt to improve an overall security of Roundcube installation related to the fact that people aren't using our
public_html
folder, I prepared an initial implementation of a static files server.The idea is that we do not allow direct access to static resources at all. I.e. you must use the
public_html
as your rootfolder, and that folder will contain only two files:
index.php
andstatic.php
(and maybe.htaccess
).It also solves problems people have with the links (
skins
andplugins
) in public_html folder.I'm interested in your opinion. Please, note it's not a complete solution. We'd have to:
use_secure_urls
feature,assets_path
feature,assets_dir
, as it won't be needed anymore,.htaccess
and index.php into the public_html folder.Let me know what do you think.
Reference: #8851, #5738.