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

Maintenance Mode #2449

Closed
jbpenrath opened this issue Jun 26, 2024 · 6 comments
Closed

Maintenance Mode #2449

jbpenrath opened this issue Jun 26, 2024 · 6 comments

Comments

@jbpenrath
Copy link
Member

Feature Request

Is your feature request related to a problem or unsupported use case? Please describe.
Currently, with Richie, this is not possible to mention that the website is under maintenance so during infrastructure operation which implies some service to be turned off, the site can be still online but malfunctions.

To help user to understand what is happening, we could display an info banner when the website is under maintenance. We should be able to switch maintenance mode from the site administration.

@igobranco
Copy link
Collaborator

@jbpenrath I have implemented a similar feature on our site, 2 years ago... It was an urgent stuff, just before a big migration that we had...
fccn/nau-richie-site-factory@5ece2ba

It is just a big message "In Maintenance" on header, so people don't create tickets just because they can't enroll on a course.

I don't know if it is possible to have some static generic to the base template. Like @sandroscosta have implemented to our footer logos using a static placeholder.

Do you think that it could generalized and upstream directly to Richie?

  1. something includable before the page header
  2. even include a bellow the footer static placeholder - similar to what we have on NAU?

@jbpenrath
Copy link
Member Author

We would like to enable this maintenance mode through site attributes. Because setting this settings through an environment variable obliges us to deploy the app to enable/disable this mode.

@igobranco
Copy link
Collaborator

@jbpenrath I agree that through environment variable isn't the right solution. What do you mean through "site attributes"?

@jbpenrath
Copy link
Member Author

jbpenrath commented Jul 3, 2024

We could extend the Site model to add a maintenance BooleanField. Then in the django admin, we were able to enable/disable this mode and just show/hide the maintenance banner in the base template according to the value of this flag.

@igobranco
Copy link
Collaborator

@jbpenrath We are going to have a new maintenance window on our site. What I have planed to do is to include a JS lines via Google Tag Manager (GTM) a couple of days before to warn our users.

It requires to deploy the GTM, but Is as simple as 10 clicks... after 15 minutes all users should see the difference. The GTM JS has 15 minutes client cache.
The good news is that it will work on all UI screens (Richie + Open edX Django + and the future Open edX MFEs + other future NAU apps), it just need to include the GTM.

We are using GTM, to include multiple external JS libraries: Google Analytics, support widgets, browser upgrade warning, Cookie consent, other tracking's, etc.

Hope my comment helps.

Maintenance Banner JS example:

var maintenanceBanner = document.createElement("div");
maintenanceBanner.style = "background-color: #ffce35; font-size: 1rem;";
if (document.documentElement.lang.startsWith("pt")) {
    maintenanceBanner.innerHTML = "Devido a uma operação de manutenção, ......";
} else {
    maintenanceBanner.innerHTML = "Due to a maintenance operation, .....";
}
document.body.insertBefore(maintenanceBanner,document.body.childNodes[0]);

@jbpenrath
Copy link
Member Author

Thanks for the information @igobranco. Looks a versatile workaround 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants