flarum / framework

Simple forum software for building great communities.
http://flarum.org/
6.23k stars 830 forks source link

Advanced Maintenance #3976

Closed SychO9 closed 2 months ago

SychO9 commented 3 months ago

Currently Flarum has an offline mode that completely locks down the forum to everyone.

This can be enabled through the 'offline' => true key in config.php

Goals


Plan

There are 3 maintenance modes needed in total:

So we can allow an integer to be passed to the offline configuration key with the following possible values:

We do not have to break backwards compatibility, so a 'offline' => true can be interpreted as high maintenance mode (1).

Why include safe mode into low maintenance mode?

Preventing all extensions from booting should be limited to admin access only in case of unintended actions by users or un-scoped visibility of information.

That said, we could rename offline to maintenance and retain BC for offline=true meaning maintenance=1

Admin Login

For low maintenance, we need to allow admin login through a basic NoJs auth form. which means excluding a couple of routes from maintenance mode.

Alert

Must clearly display that the forum is in low maintenance mode.

Potentially


Pull Requests

This will be tackled in two PRs:

  1. First will be the low maintenance mode (https://github.com/flarum/framework/pull/3975)
  2. Then the safe mode.
askvortsov1 commented 3 months ago

Wouldn't the order from weakest to strictest be:

Also, why not require strings instead of numbers? Feels less likely to get wrong.

As for BC, i would be surprised if there are many forums operating perpetually in maintenance mode. Couldn't we still check if it's a literal bool though, for the purposes of people enabling offline mode during the migration?

Also, +1 on datitisev's idea of allowing the user to exclude some extensions from not being booted during maintenance mode.