jordanjay29

With MySQL it's easy enough:

FLUSH TABLES WITH READ LOCK;
SET GLOBAL read_only = 1;

To unlock:

SET GLOBAL read_only = 0;
UNLOCK TABLES;

That doesn't prevent users from attempting a write request (and erroring out) in Flarum. It would need to be coded in.

    webeindustry How would you work on the forum then? Wouldn't that just globally lock it for everybody? Even with a update, if it decided to run some kind of migration, it probably wouldn't like such a failure. I imagine changing settings at that point would also fail.
    Personally, if I need to make sure others aren't changing things, I just lock out everybody else out via ip address in the nginx server block, backup, make my changes and remove the block.

    If you want to be nice, you could return some page saying "Maintenance"

    Davis Flarum enters matinence mode when updating. There's no need.

    All updates? Or just when changing from one beta version to another?

      Davis

      Well that's nifty. I wasn't aware of that. I'm guessing it's along these lines:

      https://laravel.com/docs/5.3/configuration#maintenance-mode

      It still doesn't provide a no-downtime solution like a read-only mode would.

      Kulga

      That works for devflarum, but it would be better to have no downtime. It's likely a bit more complicated than locking all tables, and you're right that would prevent migrations.

        webeindustry It still doesn't provide a no-downtime

        I'd say you should do more investigation into the system Flarum uses. I'm not 100% sure how it works.

        9 days later
        5 months later

        Davis Absolutely not! Extremely few users find anything negative or bad about "Maintaince mode", most people associate it with "Things are being fixed". It's only a problem to know-it-all devs.

        Shut down NGINX, go into read-only-mode, go into maintaince or simply do anything you feel comfortable doing without jepordizing data corruption. The advice given here is pure BS and based on personal preference, not how the real world works.

        As a side note; I want to use this extremely "bad practise", not to update my board, but simply because i dont want my brand new Flarum forum to be live yet, it takes a lot of effort and work to create a proper community, it's not something that's ready for launch at install.

          Freddy As a side note; I want to use this extremely "bad practise", not to update my board, but simply because i dont want my brand new Flarum forum to be live yet, it takes a lot of effort and work to create a proper community, it's not something that's ready for launch at install.

          You want to use a maintenance-mode for a non-production site? I must be reading that wrong, because there doesn't seem to be much logic in that.

            Davis I'm aware of my options outside Flarum, thanks tho. My point was simply to back up the OP in the fact that this is a needed feature, for some, not so-close-minded.

            Google and Twitter is in maintaince mode quite often. But generally, i agree, when you have a multi-billion dollar website and thousands of employees, you can spend the same effort into giving the user absolutely no downtime from their content, but as long as you stay as microscopic as you have the past years, then you don't need to think about it for a split second.

            webeindustry Your correct, you didn't read it right.

              Freddy

              Not sure. Davis is correct.

              Besides in the moment updates, best practice is performing work off the live site. It makes zero sense to enter any kind of down-time, maintenance-mode or not, on a production site.

              This isn't about data corruption, it's about not knowing better approaches.

              Google & twitter are running multiple datacenters worth of servers. It just doesn't apply here.

                luceos Hmm, makes me wonder if creating a settings.offline entry would be enough to trigger this.

                webeindustry He wants a production site to be inaccessible for the maintenance period. Unrelated to Flarum updating, but merely working on setup on his own.

                (Assumed your gender, sorry.)

                webeindustry Exactly, it's about not knowing, hence, as my original post states, this is a preference, not a rule to die for as a wanna-be DevOp.

                What makes zero sense to you, might make complete sense to someone else. All i see in this thread, is some extremely close minded opinions stuck in their ways, refusing to see or accept that others don't do things exactly the way their bible says it should.

                  Freddy

                  Then I trust you would hold that same reasoning for yourself, and wish you the best!

                  Freddy Give me a second and I may have a SQL solution for you if you're comfortable mucking with your database.

                    jordanjay29 I noticed the comments above regarding the Laravel setting during upgrades, if you have something by hearth then that would be great, a clever SQL solution shouldn't be to hard to turn into a plugin so we can get a permanent solution for this as well.

                      Freddy It was simpler than SQL (yay). Mind you, there's no pretty maintenance page.

                      In config.php, on a newline before ); add

                      'offline' => true,

                      Mine looks like this:

                        array (
                            'api' => 'api',
                            'admin' = 'admin',
                         ),
                         'offline' => true,
                      );

                      Remove offline or set it to false to remove maintenance mode.

                        jordanjay29 Sweet, thank you!

                        A maintaince page is a maintaince page, as long as it does it's job then looks really doesn't matter. Don't be so superficial ? ?