Skip to content
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 check for problematic modules reqtimeout, deflate and pagespeed #14699

Closed
wants to merge 1 commit into from
Closed

Add check for problematic modules reqtimeout, deflate and pagespeed #14699

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Mar 5, 2015

Partly fixes #4783 and #14603.

Currently untested and should be just a discussion starting point how to check for such modules.

The checks also works only with mod-php5 and not with php-cgi/php-fpm

MIT licensed

@ghost
Copy link
Author

ghost commented Mar 5, 2015

Thanks a lot for your contribution! Contributions to the core repo require a signed contributors agreement http://owncloud.org/contribute/agreement/ Alternatively you can add a comment here stating that this contribution is MIT licensed. Some more details about out pull request workflow can be found here: http://owncloud.org/code-reviews-on-github/

@@ -647,6 +654,11 @@ public static function checkServer(\OCP\IConfig $config) {
}
}
}
foreach ($dependencies['modules'] as $checkModule => $module) {
if (apacheModuleEnabled($checkModule)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean if (self::apacheModuleEnabled($checkModule)) ?

@nickvergessen nickvergessen added this to the 8.1-current milestone Mar 5, 2015
@ghost
Copy link
Author

ghost commented Mar 5, 2015

@nickvergessen
Thanks for the feedback, just have changed the code as suggested.

@scrutinizer-notifier
Copy link

The inspection completed: 2 new issues, 1 updated code elements

@@ -602,8 +603,14 @@ public static function checkServer(\OCP\IConfig $config) {
'output_buffering' => false,
'default_charset' => 'UTF-8',
],
'modules' => array(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New array annotation please while at it :)

['foo']

@LukasReschke
Copy link
Member

Do we know if that lead to issues with sharing hosting environments where such modules are enabled but not necessary enabled on every virtual host?

If this is the case then please consider performing some checks using a client-side check: https://github.com/owncloud/core/blob/7e0fd8fb501459f3ff1cfa5ddb40e1c97d50d617/core/js/setupchecks.js – I think the Deflate should be signalized in the response header?

@ghost
Copy link
Author

ghost commented Mar 5, 2015

@LukasReschke
Sure, this could be the case on special server configurations but IMHO its better to show more than less infos about problematic server configs/modules.

The client-side check is probably the best way which could also catch "gzip on" (owncloud-archive/documentation#922) and ngx_pagespeed (#14604) enabled NginX servers. So to sum up:

  1. mod_deflate and "gzip on" will add the header: Content-Encoding: gzip
  2. ngx_pagespeed will add the header: X-Page-Speed: 1.9.32.1-4238
  3. mod_pagespeed will add the header: X-Mod-Pagespeed: x.y.z
  4. mod_reqtimeout -> Probably not detectable on client-side

I really don't have the knowledge in JS so if this way is preferred some one else have to do this.

@LukasReschke
Copy link
Member

mod_deflate and "gzip on" will add the header: Content-Encoding: gzip
ngx_pagespeed will add the header: X-Page-Speed: 1.9.32.1-4238
mod_pagespeed will add the header: X-Mod-Pagespeed: x.y.z

Okay. So I'll take care of those three in another PR and you update this PR accordingly? :)

@ghost
Copy link
Author

ghost commented Mar 5, 2015

If only mod_reqtimeout is left we could also just close the PR as this module is documented with owncloud-archive/documentation#897 and probably not that wide-spread as mod_deflate and pagespeed?

foreach($problematicModules as $problematicModule) {
$errors[] = array(
'error' => $l->t('The Apache module %s is enabled.', array($problematicModule)),
'hint' => $l->t('This module can cause various issues when enabled.'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no string concat please - translation extraction will fail - thx

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

then you might want to fix the whole util.php as this is used on several places. But i will just close the PR as the module check is not very reliable.

@ghost ghost closed this Mar 6, 2015
@ghost ghost deleted the problematic_modules branch March 25, 2015 06:31
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a server side check for mod_deflate to prevent corrupted files
4 participants