core icon indicating copy to clipboard operation
core copied to clipboard

public.php isn't aware of maintenance mode

Open MTGap opened this issue 13 years ago • 11 comments

public.php isn't aware of maintenance mode and attempts to render the page. This can be reproduced with shared links. I'm not sure if it should just send 503 or also show the standard maintenance mode template.

@icewind1991 @bartv2 @DeepDiver1975

MTGap avatar May 02 '13 00:05 MTGap

A 503 seems best imo

icewind1991 avatar May 02 '13 01:05 icewind1991

I should probably rephrase my description. I'm not sure what to do because I don't know if public.php is used for anything besides pages like shared links.

I'm thinking remote.php might also be in this same situation.

MTGap avatar May 02 '13 01:05 MTGap

Hmm - we implemented the maintenance page and 503 within base.php and this was working for webdav calls as well. 

Public.php and remote.php require bade.php -> it should already work.

DeepDiver1975 avatar May 02 '13 05:05 DeepDiver1975

@DeepDiver1975 Check a public link while in maintenance mode.

MTGap avatar May 02 '13 18:05 MTGap

@DeepDiver1975 Check a public link while in maintenance mode.

hey - I never said I don't trust your recognition! :smile: All I'm saying is that I don't get why it's not working because base.php is handling the maintenance mode.

DeepDiver1975 avatar May 02 '13 19:05 DeepDiver1975

All I'm saying is that I don't get why it's not working because base.php is handling the maintenance mode.

because there is a maintenance plugin for webdav (which was actually implemented by you :satisfied:) https://github.com/owncloud/core/blob/master/apps/files/appinfo/remote.php#L50 https://github.com/owncloud/core/blob/master/lib/connector/sabre/maintenanceplugin.php

georgehrke avatar Jun 03 '13 10:06 georgehrke

webdav is out of interest public.php requires lib/base.php which returns 503 in case of maintenance mode: https://github.com/owncloud/core/blob/master/lib/base.php#L218

DeepDiver1975 avatar Jun 03 '13 10:06 DeepDiver1975

but OC::checkMaintenanceMode(); is called in the handleRequest method. [1] This handleRequest method is not called by OC::init(), you have to call it manually [2]

[1] https://github.com/owncloud/core/blob/master/lib/base.php#L575 [2] https://github.com/owncloud/core/blob/master/index.php#L28

georgehrke avatar Jun 03 '13 10:06 georgehrke

good catch! :rocket:

All we need to do is to call checkMaintenanceMode in public.php after the require.

DeepDiver1975 avatar Jun 03 '13 10:06 DeepDiver1975

already done, i am just creating the pull request

georgehrke avatar Jun 03 '13 10:06 georgehrke

:awesome:

DeepDiver1975 avatar Jun 03 '13 10:06 DeepDiver1975