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

Block occ commands when in maintenance mode #37365

Closed

Conversation

miaulalala
Copy link
Contributor

Summary

Currently, occ allows execution of commands even while in maintenance mode. The CLI does warn the admin that commands are limited but the execution still works.

This PR adds an exception to block any command that isn't maintenance:mode --off or status as executing other commands is unsafe.

(Either this, or remove the misleading sentence as commands can be executed and the database is indeed available - occ user:add for example works).

Checklist

@miaulalala miaulalala requested review from szaimen and a team March 23, 2023 13:24
@miaulalala miaulalala self-assigned this Mar 23, 2023
@miaulalala miaulalala requested review from ArtificialOwl, icewind1991 and come-nc and removed request for a team March 23, 2023 13:24
@szaimen szaimen requested review from juliusknorr and nickvergessen and removed request for szaimen March 23, 2023 13:25
@miaulalala
Copy link
Contributor Author

Alternative PR by Daniel here: #37178

@nickvergessen
Copy link
Member

nickvergessen commented Mar 23, 2023

We have quite some commands in the docs where we recommend to put the instance into maintenance before (and even turn off the webserver), so I think it's intended that it still works :/

Long running and expensive things like:

  • Add missing index
  • Add primary key
  • Convert to utf8mb4

And so on come to mind.

@miaulalala
Copy link
Contributor Author

We have quite some commands in the docs where we recommend to put the instance into maintenance before (and even turn off the webserver), so I think it's intended that it still works :/

Long running and expensive things like:

  • Add missing index
  • Add primary key
  • Convert to utf8mb4

And so on come to mind.

Then Daniel's version is the superior approach. Closing this then.

@miaulalala miaulalala closed this Mar 23, 2023
@szaimen szaimen deleted the enh/block-occ-commands-in-maintenance-mode branch March 23, 2023 19:50
violethaze74

This comment was marked as spam.

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

Successfully merging this pull request may close these issues.

3 participants