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

[RFC] safe-mode #44765

Open
wants to merge 11 commits into
base: 5.3-dev
Choose a base branch
from
Open

[RFC] safe-mode #44765

wants to merge 11 commits into from

Conversation

alikon
Copy link
Contributor

@alikon alikon commented Jan 21, 2025

RFC Pull Request for Issue #44643 .

Summary of Changes

Add a new switch in the configuration.php to enable a "Safe Mode"
when "Safe Mode" is switched on it disables all non core plugin and take a "list"
when "Safe Mode" is on it keep track of non core plugin events and update the "list"
when "Safe Mode" is switched off enable the disabled non core plugin still in the "list"

Testing Instructions

use the prebuild https://artifacts.joomla.org/drone/joomla/joomla-cms/5.3-dev/44765/downloads/81566/

enable some non core plugin
Global Configuration -> System -> Debug

set safe mode on

image

Extensions: Manage check that all non core plugin are disabled

image

enable/update/delete etc a disabled plugin all works as usual

as example unistall one

Global Configuration -> System -> Debug

set safe mode off

all the previously disabled non core plugin still in the list are enabled

image

Actual result BEFORE applying this Pull Request

N/A

Expected result AFTER applying this Pull Request

a switch for disable / enable non core plugins

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-5.3-dev RFC Request for Comment labels Jan 21, 2025
@dgrammatiko
Copy link
Contributor

dgrammatiko commented Jan 21, 2025

@alikon nice work here. If I may I would like to propose another approach with less db stuff. We could use a reflection here to reset the plugins, in run time, similar to https://github.com/dgrammatiko/jailed-fs/blob/95444d8778e930a0360740e3b511b23bde374a5c/src/plugins/system/restrictedfs/src/Extension/RestrictedFS.php#L68-L78

You need to figure out what is essential and create the correct filter but should be an easier approach, ie not messing around with the real data in the db...

Also, I would use a URL parameter, ie joomla_safe_mode=true that will be checked by the plugin, together with the user permission, ie only users in the administrators group to activate the safe mode.

@alikon
Copy link
Contributor Author

alikon commented Jan 23, 2025

@dgrammatiko let's see 1st if it gets a consensus

@alikon alikon marked this pull request as ready for review January 23, 2025 10:04
@micker
Copy link

micker commented Feb 4, 2025

ouahhhhhh great toooool, an idea for futur add step in upgrade to switch automatic to safe mode during update and propose to disable safe mode at ending process. That can be cool to protect upgrade process

@laoneo
Copy link
Member

laoneo commented Feb 4, 2025

Not sure if it helps, but HA has also such a "feature".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language Change This is for Translators PR-5.3-dev RFC Request for Comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants