Closed SychO9 closed 2 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.
Currently Flarum has an
offline
mode that completely locks down the forum to everyone.This can be enabled through the
'offline' => true
key inconfig.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:0
: no maintenance mode.1
: high maintenance mode (complete lock down).2
: low maintenance mode (admin access/admin login allowed)3
: safe mode: low maintenance mode + no extensions booting.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
tomaintenance
and retain BC foroffline=true
meaningmaintenance=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
2
&3
but not1
.Pull Requests
This will be tackled in two PRs: