server icon indicating copy to clipboard operation
server copied to clipboard

Plain maintenance mode page

Open MorrisJobke opened this issue 8 years ago • 21 comments

The maintenance mode page is currently in Nextcloud branding and doesn't respect the theming app or themes, because nothing of this is loaded during that. We should maybe update the maintenance page to a plain unbranded page that would not contain any Nextcloud branding, but a generic branding to not interfere with branded versions of Nextcloud.

Should we maybe simply load the content from a static HTML file instead to allow easy customisation even if nothing else is loaded?

@nextcloud/designers Do you have an idea for this?

cc @juliushaertl @rullzer

MorrisJobke avatar Jul 19 '17 13:07 MorrisJobke

Could we not also feed the stuff from the theming app into there? Even if it’s maintenance mode, the page should look nice. Otherwise people’s frustration about an unexpected error is amplified by the ugly look of the page.

(At the very least, the page should stay the same if not themed, and themed instances could deactivate the styles or so.)

jancborchardt avatar Aug 12 '17 17:08 jancborchardt

The problem is that we don't know if it is themed because the database could have changed and we try to access columns with new names, but old DB layout.

MorrisJobke avatar Aug 13 '17 12:08 MorrisJobke

Don’t we get that from the config.php?

jancborchardt avatar Aug 13 '17 13:08 jancborchardt

No - it is an app ;) the theming app ;)

MorrisJobke avatar Aug 13 '17 15:08 MorrisJobke

@rullzer Is the new AppData available without accessing to the database? Because then we maybe could just cache the themed maintenance page there.

juliusknorr avatar Aug 27 '17 12:08 juliusknorr

Nope needs the db

rullzer avatar Sep 21 '17 20:09 rullzer

As I've MorrisJobke understood, it is, because no app is loaded for this time and thus also the app data and the theming app is not available. Nevertheless there is the idea of a plain maintenance mode page.

Okay, are there any more specific plans as to when this function will be available?

Currently a hardcoded page is loaded from the filespace to display the Maitenance page, right?

Alternatively I could imagine the following:

As soon as the color and/or slogan exactly this hard-coded page is written individually into the filespace with the updated changes and then the file is signed. In a maintenance case exactly this individual page can be loaded and displayed.

So there would be no excited questions from users who are currently calling excitedly and asking if we have been compromised or hacked, since the site suddenly looks completely different (in colour) and the slogan / footnote also indicates that something can't be right.

Django-BOfH avatar Apr 05 '18 13:04 Django-BOfH

As soon as the color and/or slogan exactly this hard-coded page is written individually into the filespace with the updated changes and then the file is signed. In a maintenance case exactly this individual page can be loaded and displayed.

Sadly we can't write to a random location and thus need to write to the data dir. And writing to the data dir is not possible, because we need the DB to fetch the info that is needed to read from any possible data dir implementation. :/

MorrisJobke avatar Apr 05 '18 15:04 MorrisJobke

HI Morris,

Am 05.04.2018 um 17:49 schrieb Morris Jobke:

Sadly we can't write anywhere. And writing to the data dir is not possible, because we need the DB to fetch the info that is needed to read from any possible data dir implementation. :/

All right, I understand.

What about the mentioned solution with the plain maintenance mode page? Can you tell us when this could be done? Are there already plans in the current release note 13?

Best regards Django

Django-BOfH avatar Apr 05 '18 17:04 Django-BOfH

No further details are available as of now.

MorrisJobke avatar Apr 05 '18 21:04 MorrisJobke

No further details are available as of now.

Well, the best thing will be, I build my own static error page, which I have delivered by the web server in maintenance-mode.

Django-BOfH avatar Apr 06 '18 16:04 Django-BOfH

Well, the best thing will be, I build my own static error page, which I have delivered by the web server in maintenance-mode.

Yes. This sounds like a decent plan and makes also sense. Just one config option inside Nextcloud with the path to the file and then we serve only this as HTML and are done. For styles you need to inline CSS, but this should be fine for the maintenance page itself.

@rullzer @jancborchardt @skjnldsv Should we do it like that?

MorrisJobke avatar Apr 09 '18 08:04 MorrisJobke

I doubt many people will go through the trouble of customizing that as it's seen so rarely (ideally never).

A config option (not in the interface) would be the most here.

In normal cases, the maintenance mode page having regular Nextcloud look is not really that big of an issue. (Of course if it would be possible to automatize, we should – but as you said it's not.)

jancborchardt avatar Apr 09 '18 08:04 jancborchardt

I doubt many people will go through the trouble of customizing that as it's seen so rarely (ideally never).

Well, i remember there were already quite some issues reported for that. So people want their maintenance page themed as well. :wink:

Yes. This sounds like a decent plan and makes also sense. Just one config option inside Nextcloud with the path to the file and then we serve only this as HTML and are done. For styles you need to inline CSS, but this should be fine for the maintenance page itself.

We could also just go for the theme folder and look for existence of a special maintenance template file there. As far as I remember, we should be able to do that without the need of having the database available.

juliusknorr avatar Apr 09 '18 09:04 juliusknorr

I just gave it a try and a custom theme can already be used to style the maintenance page by adding

  • themes/example/css/guest.css
  • themes/example/templates/update.user.php

So we already have the possibility to theme this page for advanced users, not sure if we need anything else.

juliusknorr avatar Apr 09 '18 10:04 juliusknorr

I just gave it a try and a custom theme can already be used to style the maintenance page by adding

themes/example/css/guest.css themes/example/templates/update.user.php So we already have the possibility to theme this page for advanced users, not sure if we need anything else.

The idea here was to get people off the themes, because they often broke more stuff than helped to fix issues.

MorrisJobke avatar Apr 09 '18 10:04 MorrisJobke

I think the theme itself is not that big a deal. Reverting to the standard Nextcloud theme during Maintenance is fine imho. However, being able to add a line to config.php (it could/should be static string) with a custom message would go a long way with any admin trying to communicate maintenance downtime with their users. Something along the lines of

maintenance_message => 'We are down for planned maintenance from X to Y. Sorry for any inconvenience caused'

In real world scenarios this communication is sent out by email, and in big enterprises with many systems, you might as well send this message by carrier pigeon or telegram. People ignore and delete it, and then panic when the service is not available. Having a transparent message displayed with facts about how long the service will be down, will go a VERY long way.

@MorrisJobke any idea if this possible? And if so, any further development on the stuff mentioned in this ticket so far?

hanserasmus avatar Nov 30 '18 05:11 hanserasmus

Coming into this sorta late, but I'm wondering if in combination of adding the maintenance_message a file check could be made prior to loading the maintenance template. Excuse the Pseudocode code but something like

if (file_exists( 'maintenance-custom.php)) {
   //load custom maintenance template
} else {
    //nothing to see here, load Nextcloud branded page
}

Users could then either copy the default file to root or a template could be provided.

BrookeDot avatar Jan 10 '19 19:01 BrookeDot

@juliushaertl we could also have an offline config file that reflect the exact data theming is using? A file that the theming app updates alongside the db?

skjnldsv avatar May 02 '19 07:05 skjnldsv

@juliushaertl we could also have an offline config file that reflect the exact data theming is using? A file that the theming app updates alongside the db?

Keep clustered environments in mind, where this request is coming from typically.

MorrisJobke avatar May 02 '19 08:05 MorrisJobke

Is there any updates on this on 2021?

elhananjair avatar Oct 09 '21 18:10 elhananjair