flarum / framework

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

Read-only mode for use during maintenance #459

Closed huobazi closed 3 years ago

huobazi commented 9 years ago

I would like to suggest a readonly settings for maintenance or when your site moving from IDC 1 to IDC 2

example for moving workflow:

www.yourname.com ------> 10.10.10.1 (old server) readonly the forum on old server moving the forum and data to the new server change DNS(A record) www.yourname.com ------> 100.100.100.1 (new server) disable readony settings on the new server readonly the old server 48 hours+ then shutdown it

ref: http://discuss.flarum.org/d/945-read-only-mode-for-use-during-maintenance

johnhearfield commented 8 years ago

Or a check which redirects to a maintenance page which automatically refreshes every 60 seconds or something?

jordanjay29 commented 7 years ago

Encountered this in a recent Flarum support request. The hack is simple, add an offline key to config.php, but Flarum can do this through a service provider like Flagrow does here.

I'm thinking this may require a few things to be viable.

  1. A maintenance page designed. Currently is sends a 503 with a custom error message. This works for the admin, but normal users may be confused.
  2. An admin login page if logged out when /admin/ is accessed.
  3. A toggle in the admin panel (Basics?) to enter maintenance/offline mode.

I'm wondering if this is something where a PR would be accepted.

ghost commented 7 years ago

As an addition to @jordanjay29 request, that the board should be locked for visitors during maintenance but open for admins as the OP suggests, (Perhaps in read only mode?). Giving admins access over the board and administration area despite "maintenance" mode.

martignoni commented 5 years ago

Any news on this?

luceos commented 5 years ago

Adding a key offline to your config.php and setting the value of it to true will disable the frontpage but allows you to go into the admin area.

I'm not sure why this is still open, except perhaps to make the feature more visible or to allow setting this from the admin panel..

martignoni commented 5 years ago

Adding a key offline to your config.php and setting the value of it to true will disable the frontpage but allows you to go into the admin area.

Yes I did this, but my question was indeed about these features: https://github.com/flarum/core/issues/459#issuecomment-290326837, a not so nerdy maintenance page with a nice GUI to enable it 😄

broxinagil commented 5 years ago

I as well would appreciate a maintenance mode which is available in other Forums in General. An admin may want to reorganize discussions while normal users don't should visit the Forum during this time. It should be possible to set a permission "Allow Acces during maintenance" on Groups, Maybe as well with the possibility to choose between no acces, read and read/write mode.

martignoni commented 5 years ago

@broxinagil What you describe still exists: you just have to add offline: true to your config.php file, as already stated above.

IMHO what is needed is a friendly GUI to do it, and a likewise friendly customizable maintenance page for clients during maintenance mode (see above).

matteocontrini commented 5 years ago

@martignoni unless I'm doing something wrong, that option disables the whole site (admin area included) for everyone (administrators included)

martignoni commented 5 years ago

If you're logged in as an admin before you set it, you can access admin area anyway after setting it.

broxinagil commented 5 years ago

@martignoni I know about this setting, but this only leaves the admin-area open (but only if I was logged in before) and I'm not able to access the discussions. As well the output on "offline: true" is poor, without any Information about the reason, therefore looks non-professional to the end-user. Even I can not allow mods to help reorganizing in this mode.

matteocontrini commented 5 years ago

@martignoni I just tried again and I always get the maintenance message 🤔

broxinagil commented 5 years ago

I can confirm what @matteocontrini says. Admin-Area is disabled as well. Maybe something changed in core in Beta-8.1, as I remember this setting was working before for admin-area.

martignoni commented 5 years ago

Yes, I confirm. It was working as of 0.1.0-beta.7. So it is a regression IMHO. Last time I used it was for migrating 😉. I updated this thread: https://discuss.flarum.org/d/4102-a-way-to-make-the-forum-go-into-maintenance-mode/29.

luceos commented 5 years ago

@matteocontrini could you please create a new issue that references this one? This issue is about a remake of the maintenance page not about it not working. Thank you.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum. In any case, thanks for taking an interest in this software and contributing by opening the issue in the first place!

martignoni commented 4 years ago

AFAIK this is still here and should be fixed.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum. In any case, thanks for taking an interest in this software and contributing by opening the issue in the first place!

martignoni commented 4 years ago

IMHO, this should be fixed.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum. In any case, thanks for taking an interest in this software and contributing by opening the issue in the first place!

martignoni commented 4 years ago

It's a pity we don't have a GUI to toggle maintenance mode in Flarum. Any news here?

cc/ @jordanjay29 @franzliedke

w-4 commented 4 years ago

As an addition to @jordanjay29 request, that the board should be locked for visitors during maintenance but open for admins as the OP suggests, (Perhaps in read only mode?). Giving admins access over the board and administration area despite "maintenance" mode.

There is a simple way to do it if you're using nginx. Here's how I implemented it:

set $maintenance off;

if ($cookie_bypass_maintenance_mode) {
   set $maintenance off;
}

location / {
   if ($maintenance = on) {
       error_page 503 /maintenance.html;
       return 503;
    }
}

location = /maintenance.html {
     internal;
}

Turning maintenance mode on is done by setting the $maintenance variable to on. Then set for yourself a cookie "bypass_maintenance_mode" (just as an example) and you can access the full site while other visitors will get the maintenance page. You could probably also implement the read-only mode in a similar way with some tweaking.

martignoni commented 4 years ago

Yes, we all know how to enable maintenance mode by editing a file :-) (please read the thread).

This is about having a GUI option to do this simple operation in Flarum.

matteocontrini commented 4 years ago

Maintenance mode can be achived through this extension, but this issue is actually about a read-only mode.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum. In any case, thanks for taking an interest in this software and contributing by opening the issue in the first place!

stale[bot] commented 3 years ago

We are closing this issue as it seems to have grown stale. If you still encounter this problem with the latest version, feel free to re-open it.